package com.taxshare.manager;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.spring.web.SpringfoxWebMvcConfiguration;

/**
 * @ClassName: ManagerApplication
 * @Description:
 * @author: luozhongyi
 * @date: 2021/1/14 11:30
 */
@ConditionalOnClass(SpringfoxWebMvcConfiguration.class)
@SpringBootApplication
@EnableDiscoveryClient
@ComponentScan("com.taxshare")
@MapperScan(basePackages = { "com.taxshare.manager.mapper"})
@EnableFeignClients
@Slf4j
public class ManagerApplication implements WebMvcConfigurer {

	public static void main(String[] args) {
		SpringApplication.run(ManagerApplication.class, args);
		log.error(">>>>>>>>>Manager完美启动>>>>>>>>");
	}
	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
		registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
	}
}
